package example3;

public class Business {
	IWriter writer;

	public Business(String wname) {
		writer = new WriterFactory().getWriter(wname); // 从工厂获得
	}

	public void save() {
		System.out.println("业务数据保存");
		writer.save();
	}
	
	public static void main(String[] args) {
		Business business = new Business("UsbDiskWriter");
		business.save();
	}
}
